package com.health.healthproject.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.health.healthproject.common.Result;
import com.health.healthproject.dto.HealthLogDTO;
import com.health.healthproject.entity.HealthLog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 健康日志Mapper接口
 */
@Mapper
public interface HealthLogMapper extends BaseMapper<HealthLog> {

    /**
     * 根据ID查询健康日志详情（包含用户信息）
     */
    HealthLogDTO getHealthLogDetail(@Param("id") Long id);

    /**
     * 分页查询健康日志（包含用户信息）
     */
    IPage<HealthLogDTO> pageHealthLogList(Page<HealthLog> page, @Param("query") HealthLog query);


    List<HealthLog> getStats(@Param("loginId") Long loginId);
}